<?php 
global $options;
foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
$dateformat = get_option('date_format');
$timeformat = get_option('time_format');
get_header(); ?>


<div id="content">
<div class="wrap">     

	<?php wp_reset_query();	if (have_posts()) : while (have_posts()) : the_post(); 
	$cfType = get_post_meta($post->ID, 'wpzoom_post_template', true);
	?>
	
	
	<div class="single<?php if ($cfType == 'Sidebar on the left') { echo" single-left"; } ?>">

		<h1><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
		
		<p class="postmetadata"><?php _e('By', 'wpzoom');?> <?php the_author_posts_link(); ?> <?php _e('in', 'wpzoom');?> <span class="category"><?php the_category(', '); ?></span> <?php _e('on', 'wpzoom');?> <span class="datetime"><?php the_time("$dateformat $timeformat"); ?></span><?php edit_post_link( __('EDIT', 'wpzoom'), ' | ', ''); ?></p>
		<div class="sep">&nbsp;</div>
		
		<div class="content-big<?php if ($cfType == 'Full Width (no sidebar)') { echo" content-wide"; } ?>">
			
			<?php if (strlen($wpzoom_ad_content_imgpath) > 1 && $wpzoom_ad_content_select == 'Yes' && $wpzoom_ad_content_pos == 'Before') { echo '<div class="banner">'.stripslashes($wpzoom_ad_content_imgpath)."</div>"; }?>
			
			<?php the_content(''); ?>
			<div class="clear">&nbsp;</div>
			<?php wp_link_pages(array('before' => '<p class="pages"><strong>'.__('Pages', 'wpzoom').':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
			<?php the_tags( '<p class="tags"><strong>'.__('Tags', 'wpzoom').':</strong> ', ', ', '</p>'); ?>
			
			<?php if (strlen($wpzoom_ad_content_imgpath) > 1 && $wpzoom_ad_content_select == 'Yes' && $wpzoom_ad_content_pos == 'After') { echo '<div class="banner">'.stripslashes($wpzoom_ad_content_imgpath)."</div>"; }?>
			
			<?php comments_template(); ?> 
		</div><!-- end .content-big -->
		        
		<?php if ($cfType != 'Full Width (no sidebar)') { ?>
		<div class="content-narrow">
			<?php get_sidebar(); ?>
		</div><!-- end .content-narrow -->
		<?php } // if template = wide ?>
		
		<div class="clear">&nbsp;</div>
		<div class="sep">&nbsp;</div>
	
	</div><!-- end .single -->
	
	<?php endwhile; endif; ?>	

</div><!-- end .wrap -->
</div><!-- end #content -->
<?php get_footer(); ?>
